package com.yuke.cloud.service.cmc.controller.frontend;

import com.yuke.cloud.common.core.support.BaseController;
import com.yuke.cloud.common.util.wrapper.WrapMapper;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import com.yuke.cloud.service.api.cmc.dto.CmsSecKillAndSkuDto;
import com.yuke.cloud.service.cmc.dto.CmsPromoteUpReduceDto;
import com.yuke.cloud.service.cmc.service.CmsSecKillService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
 * <p>Company: Copyright (c) 2018. yuke All Rights Reserved. </br> </p>
 * <p>Title：yukemall </br> </p>
 * <p>com.yuke.cloud.service.cmc.controller.frontend Description TODO </br> </p>
 * @Author wg
 * @Date   2019/6/6 15:49
 */
@Api(value = "WEB - MallCmsPromoteController", tags = "处理促销活动相关请求", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RestController
@RequestMapping("/mall/cms/promote")
public class MallCmsPromoteController extends BaseController {

    @Value("${yuke.promote.first-order.isEnable}")
    private Boolean isEnable;

    @Value("${yuke.promote.first-order.upAmount}")
    private Integer upAmount; // 满减活动满upAmount分

    @Value("${yuke.promote.first-order.reduceAmount}")
    private Integer reduceAmount; // 满减活动减reduceAmount分

    @GetMapping("/getFirstOrderPromote")
    @ApiOperation(httpMethod = "GET", value = "获取用户首单满减活动信息")
    public Wrapper<CmsPromoteUpReduceDto> getFirstOrderPromote() {
        CmsPromoteUpReduceDto cmsPromoteUpReduceDto = new CmsPromoteUpReduceDto();
        cmsPromoteUpReduceDto.setIsEnable(isEnable);
        cmsPromoteUpReduceDto.setUpAmount(upAmount);
        cmsPromoteUpReduceDto.setReduceAmount(reduceAmount);

        return WrapMapper.ok(cmsPromoteUpReduceDto);
    }
}
